  var userId = systemUserId = $("#cc_bspid").val();
    //var callcenter_phone_event = function (type, data) {
    //    if (type == "Hangup" && data.isConnected=="1")
    //        talkingEvent(data.Phone);
    //    };
    var handlers = {
        //一键外呼,请勿重写，直接调用
        callphone: function (phone, businessdata) { },
        callphone_aes: function (phone,displyphone, businessdata) { },
        //点击拨打按钮
        onbeforecall: function (phone) {
            var businessdata = {};
            console && console.log("onbefore call " + phone);
            handlers.callphone(phone, businessdata);
        },
        //外呼进来 开始响铃时，如需，重写业务逻辑
        'onring': function (phone, callid) {
            console && console.log("onring");
            console && console.log(phone);
            console && console.log(callid);
        },
        //通话成功挂断时，如需，重写业务逻辑
        'on_success_hangup':
            function (startdatetime, enddatetime, phone, timelong, callid, direction) {
                console && console.log("on_success_hangup");
                console && console.log(startdatetime + " " + enddatetime + " " + phone + " " + timelong + " " + callid + " " + direction);
                ////talkingEvent && talkingEvent(phone);
            },
        //电话条非成功挂断时，如需，重写业务逻辑
        'on_fail_hangup': function (startdatetime, enddatetime, phone, timelong, callid, direction) {
            console && console.log("on_success_hangup");
            console && console.log(startdatetime + " " + enddatetime + " " + phone + " " + timelong + " " + callid + " " + direction);
            ////talkingEvent && talkingEvent(phone);
        },
        //外呼开始时，如需，重写业务逻辑
        'oncalldata': function (startdatetime, extnum, callid) {
            console && console.log("oncalldata");
            console && console.log("startdatetime:" + startdatetime + ",extnum: " + extnum + ",callid:" + callid);
        },
        //坐席接通时，或外呼接通时，如需，重写业务逻辑
        'onconnected': function (startdatetime, extnum, callid) {
            console && console.log("onconnected");
            console && console.log("startdatetime:" + startdatetime + ",extnum: " + extnum + ",callid:" + callid);
        },
        //登录完成，如需，重写业务逻辑
        'onlogined': function (extnum) {
            console && console.log("onlogined");
            console && console.log(extnum);
        },
        'onlogouted': function () {
            console && console.log("onlogouted");
        },
        //电话条html渲染完成，如需，重写业务逻辑
        'on_phonebar_inited': function () {
            console && console.log("on_phonebar_inited");
        },
        //是否可以使用以下 get或set status方法
        can_get_set_status: false,
        //设置电话条状态,切勿实现此方法，直接调用，can_get_set_status 为 true时可以使用此方法,目前只允许设置 空闲或小休
        'setStatus': function (state) {

        },
        //获取电话条状态,切勿实现此方法，直接调用，can_get_set_status 为 true时可以使用此方法
        'getStatus': function () {

        },

        'retryCount': 10,
        'ensureCallcenterLoaded': function () {
            if (handlers.can_get_set_status) {
                console.log("callcenter加载完成");
            } else {
                if (--handlers.retryCount > 0) {
                    window.setTimeout(handlers.ensureCallcenterLoaded, 1000);
                }
            }
        }
    };
    handlers.ensureCallcenterLoaded();